package com.dk.service.impl;

import com.dk.mapper.TbCollectionMapper;
import com.dk.pojo.TbCollection;
import com.dk.service.TbCollectionService;
import com.dk.vo.TbCollectionVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TbCollectionServiceImpl implements TbCollectionService {

    @Resource
    private TbCollectionMapper collectionMapper;

    @Override
    public TbCollection selectAllByUidAndMid(Long uid, Long cid) {

        TbCollection collections = collectionMapper.selectAllByUidAndMid(uid, cid);
//        TbCollectionVO collectionVO = new TbCollectionVO();
//        BeanUtils.copyProperties(collections, collectionVO);
        return collections;
    }

    @Override
    public void addCollection(Long cid, Long uid) {
        collectionMapper.addCollection(cid,uid);
    }
}
